<template>
  <div class="app-panel-group">
    <a-row :gutter="40" class-name="panel-group">
      <a-col v-for="chart in chartList" :key="chart.num" class="card-panel-col" :lg="6">
        <div class="card-panel">
          <div class="card-panel-icon">
            <Icon
              :type="chart.icon"
              :style="`fontSize: 55px;color: ${chart.color}`"
            />
          </div>
          <div className="card-panel-description">
            <p className="card-panel-text">{{ chart.type }}</p>
            <span class="card-panel-num">{{ chart.num }}</span>
          </div>
        </div>
      </a-col>
    </a-row>
  </div>
</template>

<script lang="ts">
import { defineComponent, } from 'vue'

const chartList = [
  {
    type: '访客',
    icon: 'UserOutlined',
    num: 102400,
    color: '#40c9c6',
  },
  {
    type: '待办',
    icon: 'MessageOutlined',
    num: 81212,
    color: '#36a3f7',
  },
  {
    type: '利润',
    icon: 'DollarCircleOutlined',
    num: 9280,
    color: '#f4516c',
  },
  {
    type: '成本',
    icon: 'ShoppingCartOutlined',
    num: 13600,
    color: '#f6ab40',
  },
]

export default defineComponent({
  setup() {
    return {
      chartList
    }
  }
})
</script>

<style lang="scss">
.app-panel-group{
  position: relative;
  .panel-group{
    margin-bottom: 20px;
  }
  .card-panel{
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);
    &:hover {
      .card-panel-icon-wrapper {
        background: #ccc;
      }
    }
    .card-panel-icon{
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }
    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;
      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }
      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}
</style>
